package com.mvc.demo;

import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.List;

public class SampleClass {
    private String sampleField;
    private List<Integer> ids;
    public String getSampleField() {
        return sampleField;
    }
    public void setSampleField(String sampleField,String name,String name2) {
        this.sampleField = sampleField;
    }
    public List<Integer> getIds() {
        return ids;
    }
    public void setIds(List<Integer> ids) {
        this.ids = ids;
    }
    public static void main(String[] args) {
        Class sampleClassClass = SampleClass.class;
        Method[] methods = sampleClassClass.getMethods();
        for (Method method : methods) {
            System.out.println("------------------" + method.getName());
            Type[] genericParameterTypes =
                    method.getGenericParameterTypes();
            Class<?>[] parameterTypes = method.getParameterTypes();
            for (Class parameterType : parameterTypes) {
                System.out.println(parameterType + "====" +
                        parameterType.getName());
            }
            for (int i = 0; i < genericParameterTypes.length; i++) {
                System.out.println(genericParameterTypes[i] +
                        "=====" + genericParameterTypes[i].getTypeName());
            }
        }
    }

}
